package com.yao.component.main;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.yao.sdk.cache.filestore.FileStoreProxy;
import com.yao.sdk.cache.filestore.TestObj;
import com.yao.sdk.core.YaoSDK;
import com.yaoming.umengshare.SharePlatform;
import com.yaoming.umengshare.UmShare;
import com.yaoming.umengshare.UmShareConfig;

public class MainActivity extends Activity {


    Button button;
   // SimpleDraweeView simpleDraweeView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

     /*   CircleView circleView = (CircleView) findViewById(R.id.circle_list);
        circleView.getCircleStyle().setItemNameTextColor(R.color.gray).setCommentItemNameTextColor(R.color.gray)
        .setItemContentOptTextColor(R.color.gray);
        circleView.setDataSource(new DefaultDataSource());
        circleView.refresh();*/
        YaoSDK.init(this.getApplication());
        button = (Button) findViewById(R.id.btn);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                testQiniu();
                UmShare share=new UmShare(MainActivity.this);
                share.setText("拱趴分享内容22");
                share.setTitle("拱趴11");
//                share.setImage("http://dev.umeng.com/images/tab2_1.png");
                share.share();
            }
        });

      //  simpleDraweeView = (SimpleDraweeView) findViewById(R.id.image);
       // Uri uri = Uri.parse("http://7xoezl.com1.z0.glb.clouddn.com/circle%2Fpost%2F2015-12-01_13-02-58_0");
        Uri uri = Uri.parse("https://raw.githubusercontent.com/facebook/fresco/gh-pages/static/fresco-logo.png");
       // simpleDraweeView.setImageURI(uri);

        /*ImageRequest request = ImageRequestBuilder
                .newBuilderWithSource(uri)
                .setProgressiveRenderingEnabled(true)
                .build();
        AbstractDraweeController controller = Fresco.newDraweeControllerBuilder()
                .setImageRequest(request)
                .setOldController(simpleDraweeView.getController())
                .build();

        simpleDraweeView.setController(controller);*/
    }




    private void testQiniu() {
        TestObj testObj = new TestObj();
        testObj.a = "aa";
        testObj.f = true;
        testObj.i = 10;
        FileStoreProxy.setObject("t", testObj);
        TestObj testObj1 = FileStoreProxy.getObject("t", TestObj.class);
        System.out.println(testObj1);
        System.out.println("a=" + testObj1.a);
        System.out.println("f=" + testObj1.f);
        System.out.println("i=" + testObj1.i);

    }


}
